package com.quan.common.handler.elasticjob.job;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.quan.common.utils.DateUtils;

@Component
public class SimpleElasticJob implements SimpleJob {

	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Override
	public void execute(ShardingContext shardingContext) {
		logger.info("时间：{}, 任务名：{}, 片数：{}, id={}",  
				DateUtils.getDateTime(), 
				shardingContext.getJobName(), 
				shardingContext.getShardingTotalCount(),
                shardingContext.getJobParameter());
	}

}
